package Visual;



import java.awt.*;

import javax.swing.*;
import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder;





/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class NewJFrame extends javax.swing.JFrame {

	{
		//Set Look & Feel
		try {
			javax.swing.UIManager.setLookAndFeel("com.jgoodies.looks.plastic.PlasticXPLookAndFeel");
		} catch(Exception e) {
			e.printStackTrace();
		}
	}

	private JPanel PanelBotones;
	private JPanel PanelJugador;
	private JLabel LabelJugador;
	private JLabel LabelCantNafta;
	private JLabel LabelNafta;
	private JTextField TextRobot;
	private JPanel PanelTexto;
	private JButton BotonDejar;
	private JButton BotonAgarrar;
	private JLabel LabelPuntaje;
	private JComboBox<String> CBColores;
	private JPanel Grilla;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		
				NewJFrame inst = new NewJFrame();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
				
	}
		
	
	
	public NewJFrame() {
		super("Linguo2");
		initGUI();
	}
	
	private void initGUI() {
		try {
			BorderLayout thisLayout = new BorderLayout();
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(thisLayout);
			{
				//Panel Botones
				
				JButton botonAv,botonIzq,botonDer,botonPintar;
				TitledBorder t= new TitledBorder("");
				PanelBotones = new JPanel();
				TableLayout PanelBotonesLayout = new TableLayout(new double[][] {{0.0, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL}, {47.0, 51.0, 60.0, 57.0}});
				PanelBotonesLayout.setHGap(5);
				PanelBotonesLayout.setVGap(5);
				getContentPane().add(PanelBotones, BorderLayout.WEST);
				PanelBotones.setLayout(PanelBotonesLayout);
				PanelBotones.setPreferredSize(new java.awt.Dimension(153, 153));
				PanelBotones.setBorder(BorderFactory.createTitledBorder(t, "Controlador", TitledBorder.CENTER,TitledBorder.CENTER , null, Color.BLUE));
				
				botonAv=new JButton ("A");
				botonIzq=new JButton ("I");
				botonDer=new JButton ("D");
				botonPintar= new JButton ("P");
				PanelBotones.add(botonAv, "2, 0");
				PanelBotones.add(botonIzq, "1, 1");
				PanelBotones.add(botonDer, "3, 1");
				PanelBotones.add(botonPintar, "1, 3");
				{
					ComboBoxModel<String> CBColoresModel = 
							new DefaultComboBoxModel<String>(
									new String[] { "Seleccionar color","Negro", "Blanco","Azul","Rojo","Verde" });
					CBColores = new JComboBox<String>();
					PanelBotones.add(CBColores, "2, 3, 3, 3");
					CBColores.setModel(CBColoresModel);
				}
				
				BotonAgarrar = new JButton();
				PanelBotones.add(BotonAgarrar, "1, 2");
				BotonAgarrar.setText("Ag");
				
				
				BotonDejar = new JButton();
				PanelBotones.add(BotonDejar, "2, 2");
				BotonDejar.setText("Dej");
				
			}
			{	
				//Grilla de juego
				
				GridLayout lay=new GridLayout ();
				JLabel[] arreglo=new JLabel[16];
				LineBorder line=new LineBorder (Color.BLACK);
				
				Grilla = new JPanel();
				Grilla.setLayout(lay);
				Grilla.setSize(640, 640);
				getContentPane().add(Grilla,BorderLayout.CENTER);
				
				for (int i=0;i<arreglo.length;i++){
					arreglo[i]=new JLabel();
					arreglo[i].setSize(40, 40);
				}

			}
			{	
				//Panel Jugador			
				TitledBorder t2= new TitledBorder("");
				LineBorder blackline=new LineBorder(Color.BLACK);
				PanelJugador = new JPanel();
				getContentPane().add(PanelJugador, BorderLayout.NORTH);
				PanelJugador.setPreferredSize(new java.awt.Dimension(422, 41));
			
				LabelJugador = new JLabel("Jugador");
				PanelJugador.add(LabelJugador);
				LabelJugador.setPreferredSize(new java.awt.Dimension(59, 20));
			
				LabelPuntaje = new JLabel("Puntaje");
				PanelJugador.add(LabelPuntaje);
				LabelPuntaje.setPreferredSize(new java.awt.Dimension(71, 25));
				LabelPuntaje.setBorder(blackline);
					
				LabelNafta = new JLabel();
				PanelJugador.add(LabelNafta);
				LabelNafta.setText("Nafta Disponible");
			
				LabelCantNafta = new JLabel("100");
				PanelJugador.add(LabelCantNafta);
				LabelCantNafta.setBorder(blackline);
				LabelCantNafta.setPreferredSize(new java.awt.Dimension(29, 16));
				
				PanelJugador.setBorder(BorderFactory.createTitledBorder(t2, "Jugador", TitledBorder.CENTER,TitledBorder.CENTER , null, Color.BLUE));
			}
			
			{ 
				//Panel de Texto
				PanelTexto = new JPanel();
				getContentPane().add(PanelTexto,BorderLayout.SOUTH);
				PanelTexto.setPreferredSize(new java.awt.Dimension(575, 78));
			
				TextRobot = new JTextField();
				PanelTexto.add(TextRobot);
				TextRobot.setText("Hola Jugador");
				TextRobot.setPreferredSize(new java.awt.Dimension(748, 65));
				TextRobot.setEditable(false);
			}

			pack();
			this.setSize(800, 600);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

}
